import http from './http'
import {
  bannerUrl,
  personalizedUrl,
  playlistDetailUrl,
  songDetailUrl,
  lyricUrl,
  commentUrl,
  songUrl
} from './url'

// 轮播图
export const getBannerAction = type => {
  return http.get(bannerUrl, {
    params: { type }
  })
}

// 推荐歌单
export const getPersonalizedAction = limit => {
  return http.post(personalizedUrl, { limit })
}

// 歌单详情
export const getPlaylistDetailUrlAction = id => {
  return http.post(playlistDetailUrl, { id })
}

// 歌曲详情
export const getSongDetailAction = ids => {
  return http.post(songDetailUrl, { ids })
}

// 歌词详情
export const getLyricAction = id => {
  return http.post(lyricUrl, { id })
}

// 歌曲评论
export const getCommentAction = id => {
  return http.post(commentUrl, { id })
}

// 歌曲地址
export const getSongUrlAction = id => {
  return http.post(songUrl, { id })
}
